Follow/Unfollow User
POST /:username/follow
Description
Follows, unfollows, requests to follow, or withdraws a pending request depending on the current relationship and the target account privacy.
Request Parameters
Requires Authentication: true
PATH PARAMS
| Name | Type | Required | Description |
|---|---|---|---|
username | string | Yes | Target username. |
Usage Example
await axios.post(
"https://api.daykeeper.app/johndoe/follow",
{},
{
headers: {
Authorization: `Bearer ${accessToken}`,
},
}
)
Success Response
Possible messages include:
{ "message": "You started following johndoe" }
{ "message": "You unfollowed johndoe" }
{ "message": "You sent a follow request to johndoe" }
{ "message": "You have withdrawn your request to follow johndoe" }
Error Response
| Code | Description |
|---|---|
| 401 | Missing or invalid access token |
| 402 | One of the users is blocked or the target is banned |
| 404 | User not found |
| 400 | You cannot follow yourself |
| 500 | Server error |